export default () => {
    const allPoint = document.querySelectorAll("article>h1,article>h2,article>h3,article>h4,article>h5,article>h6")
    const arrTitles = []
    const gotoPoint = (id)=>{
        document.querySelector('#'+id).scrollIntoView({ block: "start", behavior: "smooth" })
    }
    allPoint.forEach((v,i)=>{
        let timestamp = '锚点'+i
        arrTitles.push({
            title: v.textContent,
            lvl: v.nodeName.replace('H',""),
            pointTO: timestamp,
            fun: () =>{
                gotoPoint(timestamp)
            }
        })
        v.id = timestamp
    })
    return arrTitles;    
}